import {request} from './index'
const baseUrl = 'http://localhost:8080/api'
//获取经纬度
export function reqAddress(latitude,longitude){
    return request({
        url:`http://localhost:8080/api/position/${latitude},${longitude}`
    })
}
// //获取食品分类
export const reqCategorys =()=>{
    return request({
        method:'GET',
        url:baseUrl+'/index_category',
        // headers: {
        //         needToken:true
        //         }
    })
}
// //根据经纬度获取商铺列表
export const reqShops = (latitude,longitude)=>{
    return request({
        url:baseUrl+'/shops',
        params:{
            latitude,
            longitude
        },
        
    })
}
export const reqPwdLogin = (name,pwd,captcha)=>{
    return request({
        method:"POST",
        url:baseUrl+'/login_pwd',
        data:{
            name,
            pwd,
            captcha
        }
    })
}
// 获取商家信息
export const reqInfo = ()=>{
    return request({
        method:"GET",
        url:'/info'
    })
}
//获取商家评价数组
export const reqRatings = ()=>{
    return request({
        url:'/ratings'
    })
}
// 获取商家商品数组
export const reqfoods = ()=>{
    return request({
        url:'/foods'
    })
}
